LITEOSTOPDIR := ./liteos-m
LITEOSTOPDIR := $(realpath $(LITEOSTOPDIR))

# Common
C_SOURCES     += $(wildcard $(LITEOSTOPDIR)/kernel/src/*.c) \
                 $(wildcard $(LITEOSTOPDIR)/kernel/src/mm/*.c) \
                 $(wildcard $(LITEOSTOPDIR)/../bounds_checking_function/src/*.c) \
                 $(wildcard $(LITEOSTOPDIR)/utils/*.c)

C_INCLUDES    += -I$(LITEOSTOPDIR)/utils \
                 -I$(LITEOSTOPDIR)/kernel/include \
                 -I$(LITEOSTOPDIR)/../../third_party/musl/porting/liteos_m/kernel/include \
                 -I$(LITEOSTOPDIR)/../bounds_checking_function/include

# TestSuite
# C_SOURCES     +=  $(wildcard $(LITEOSTOPDIR)/testsuits/sample/kernel/task/*.c) \
#                  $(wildcard $(LITEOSTOPDIR)/testsuits/src/*.c)
                #  $(wildcard $(LITEOSTOPDIR)/testsuits/sample/kernel/event/*.c) \
                #  $(wildcard $(LITEOSTOPDIR)/testsuits/sample/kernel/hwi/*.c) \
                #  $(wildcard $(LITEOSTOPDIR)/testsuits/sample/kernel/mux/*.c) \
                #  $(wildcard $(LITEOSTOPDIR)/testsuits/sample/kernel/queue/*.c) \
                #  $(wildcard $(LITEOSTOPDIR)/testsuits/sample/kernel/sem/*.c) \
                #  $(wildcard $(LITEOSTOPDIR)/testsuits/sample/kernel/swtmr/*.c) \
                #  $(wildcard $(LITEOSTOPDIR)/testsuits/sample/kernel/task/*.c) \
                #  $(wildcard $(LITEOSTOPDIR)/testsuits/src/*.c)

#C_INCLUDES    += -I$(LITEOSTOPDIR)/testsuits/include


# Related to arch
ASM_SOURCES   += $(wildcard $(LITEOSTOPDIR)/arch/arm/cortex-m4/gcc/*.s)

ASMS_SOURCES  += $(wildcard $(LITEOSTOPDIR)/arch/arm/cortex-m4/gcc/*.S)

C_SOURCES     += $(wildcard $(LITEOSTOPDIR)/arch/arm/common/*.c)
C_SOURCES     += $(wildcard $(LITEOSTOPDIR)/arch/arm/cortex-m4/gcc/*.c)

C_INCLUDES    += -I. \
                 -I$(LITEOSTOPDIR)/arch/include \
                 -I$(LITEOSTOPDIR)/arch/arm/common \
                 -I$(LITEOSTOPDIR)/arch/arm/cortex-m4/gcc


CFLAGS        += -nostdinc -nostdlib
ASFLAGS       += -imacros $(LITEOSTOPDIR)/kernel/include/los_config.h -DCLZ=CLZ
